<?php

namespace app\admin\validate;

use think\Validate;

class ActionLogValidate extends Validate
{
    protected $message = [
        'id.require' => 'ID必须填写',
        'id.integer' => 'ID必须为整数',
        'ids.require' => 'ID列表必须填写',
        'ids.array' => 'ID列表必须为数组',
        'admin_name.require' => '管理员名称必须填写',
        'admin_name.max' => '管理员名称最多不能超过20个字符',
        'url.max' => 'URL最多不能超过255个字符',
        'ip.max' => 'IP地址最多不能超过45个字符',
        'status.in' => '状态值错误',
        'start_time.date' => '开始时间格式错误',
        'end_time.date' => '结束时间格式错误',
    ];
    protected $group = [
        'index' => [
            'page' => 'integer|egt:1',
            'limit' => 'integer|between:1,100',
            'admin_name' => 'max:20',
            'url' => 'max:255',
            'ip' => 'max:45',
            'status' => 'integer|in:0,1',
            'start_time' => 'date',
            'end_time' => 'date',
        ],
        'info' => [
            'id' => 'require|integer',
        ],
        'delete' => [
            'id' => 'require|integer',
        ],
        'batchDelete' => [
            'ids' => 'require|array',
        ],
    ];
}